<?php
class Order_Service_OrderShip
{

	
	public static function getByfield($field,$value)
	{
		$obj=new Order_Model_OrderShip();
		$rows= $obj->getByfield($field,$value);
		if(!empty($rows)){
			$rows=$rows->toArray();
		}
		return $rows;
	}

    public static function getByValue($value,$field)
    {
        $obj=new Order_Model_OrderShip();
        $rows= $obj->getByValue($value,$field);
        return $rows;
    }
	
	public static function getByTrackingNumber($TrackingNumber)
	{
		$obj=new Order_Model_OrderShip();
		$rows= $obj->getByTrackingNumber($TrackingNumber);
		
		return $rows;
	}
	
	public static function getByOrdersCode($ordersCode)
	{ 
		$obj=new Order_Model_OrderShip();
		$rows= $obj->getByOrdersCode($ordersCode);
		return $rows;
	}
	
	public static function getLastRowByOrdersCode($ordersCode)
	{ 
		$obj=new Order_Model_OrderShip();
		$rows= $obj->getLastRowByOrdersCode($ordersCode);		
		return $rows;
	}
	
	/**
	*
	*/
	public static function update($row,$t_id)
	{ 
		$obj=new Order_Model_OrderShip();
		return $obj->update($row,$t_id);
	}
	
	

	/**
	*根据状态码获得状态描述
	*return String
	*/
	public static function getOrderStatus($status)
	{ 
		$orders_status=array(
			0=>'删除',
			1=>'草稿',
			2=>'已确认',
			3=>'缺货',
			4=>'待发货',
			5=>'已发货',
			6=>'已完成',
		);
		return $orders_status[$status];
	}
	
	public static function getIP()
	{ 
		$ip=$_SERVER['REMOTE_ADDR'];
		return $ip;
	}
	
}